package com.ch.ms.data.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.AbstractPersistable;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.time.LocalDateTime;


@EqualsAndHashCode(callSuper = true)
@EntityListeners(AuditingEntityListener.class)
@MappedSuperclass
@Data
public abstract class AbstractMaplePersistable<PK extends Serializable> extends AbstractPersistable<PK> implements Serializable {
    private static final long serialVersionUID = -2261881322721004228L;


    @CreatedDate
    private LocalDateTime createdTime;


    @LastModifiedDate
    private LocalDateTime lastModifiedTime;
}
